<?php

namespace common\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "{{%shopcart}}".
 *
 * @property string $id
 * @property string $trade_id
 * @property string $uid
 * @property string $username
 * @property string $trade_name
 * @property string $trade_money
 * @property string $trade_desc
 * @property integer $status
 * @property integer $weight
 * @property string $created_at
 * @property string $updated_at
 * @property string $res1
 * @property string $res2
 * @property string $res3
 */
class Shopcart extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%shopcart}}';
    }
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [[ 'uid', 'trade_name', 'trade_money','product_id'], 'required'],
            [[ 'uid', 'status', 'weight'], 'integer'],
            [['trade_id','transaction_id','username', 'trade_name', 'trade_money','product_id'], 'string', 'max' => 40],
            [['trade_desc'], 'string', 'max' => 250],
            [['res1', 'res2', 'res3'], 'string', 'max' => 80]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'trade_id' => 'Trade ID',
            'uid' => 'Uid',
            'username' => 'Username',
            'trade_name' => 'Trade Name',
            'trade_money' => 'Trade Money',
            'trade_desc' => 'Trade Desc',
            'status' => 'Status',
            'weight' => 'Weight',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'res1' => 'Res1',
            'res2' => 'Res2',
            'res3' => 'Res3',
        ];
    }
}
